home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / computer vision recognition / rcinstall.exe / Disk1 / data1.cab / ASP_Pages / UtilHeader.asp < prev    next >
Encoding:
Text File  |  2001-12-12  |  8.4 KB  |  308 lines

  1. <!------------------------------------------------------------------------------------------------- 
  2.                           Copyright by Kofax Image Products                    
  3. -------------------------------------------------------------------------------------------------->
  4.  
  5.  
  6. <%@ LANGUAGE = VBScript %>
  7. <%
  8.     
  9.     Response.Expires = 60
  10.     Response.Expiresabsolute = Now() - 1
  11.     Response.AddHeader "pragma","no-cache"
  12.     Response.AddHeader "cache-control","private"
  13.     Response.CacheControl = "no-cache"
  14.     if Application("PubTypesPath")="" then
  15.         Dim Vroot,iCount,idx
  16.         Vroot = Server.MapPath("Default.asp")
  17.         iCount = 0
  18.         idx = InStrRev(Vroot, "\")
  19.         if (idx > 0) and (idx < len(Vroot)) then
  20.                 Vroot = Left(Vroot,idx-1)
  21.         end if
  22.         Application("PubTypesPath")=Vroot & "\PubTypes"
  23.         Application("XMLDirectory")=Vroot & "\XMLBATCH"
  24.         Application("SiteIDFile")=Vroot & "\siteid.txt"
  25.         Application("LogFile")=Vroot & "\csweblog.txt"
  26.     end if
  27.  
  28.  
  29. '---------------------------------------------------------------------------------------------------
  30. 'Getting local strings
  31. '--------------------------------------------------------------------------------------------------
  32.  
  33.         dim oConn,oRs,i,sFilePath,sLangTable
  34.         dim display(5) 
  35.         on error resume next
  36.         set oConn = Server.CreateObject("ADODB.Connection")
  37.         sFilePath=Server.MapPath("csuiweb.mdb")
  38.         
  39.         oConn.Open("Driver={Microsoft Access Driver (*.mdb)};DBQ=" & sFilePath & ";")
  40.         if err then
  41.                set oConn=nothing
  42.             err.clear
  43.             Response.Redirect("Error.asp?Err=1")
  44.         end if
  45.         sLangTable=mid(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"),1,2)
  46.         if trim("" & sLangTable)="" then
  47.             sLangTable="En"
  48.         end if    
  49.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=0")
  50.         if (err and (Err.Number=-2147217865)) then        
  51.             err.Clear
  52.             sLangTable="En"
  53.             Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=0")
  54.         end if        
  55.         Response.Write("<META HTTP-EQUIV='CONTENT-LANGUAGE' CONTENT='" & oRS("Value") & "'>")
  56. 'To begin, select a document type from below.
  57.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=4")
  58.         display(0)=oRs("Value")
  59. 'Create        
  60.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=6")
  61.         display(1)=oRs("Value")
  62. 'Error on getting published data.
  63.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=30")
  64.         display(2)=oRs("Value")
  65. 'Error on getting published data.ActiveX can not create component.
  66.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=37")
  67.         display(3)=oRs("Value")
  68. 'Choose...
  69.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=5")
  70.         display(4)=oRs("Value")
  71. 'Please select a document to begin...
  72.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=45")
  73.         display(5)=oRs("Value")
  74.  
  75.         oRs.Close
  76.         oConn.Close    
  77.         if err then
  78.             err.clear
  79.             Response.Redirect("Error.asp?Err=1")
  80.         end if    
  81. %>
  82. <html>
  83. <head>
  84.         <link rel="stylesheet" href="coversheet.css">
  85.  
  86. <script language="JavaScript">
  87. //All functions that will be used on client side are stored here
  88. //sending the change to body page and submitting it
  89. var iTimer;
  90. function SubmitChange()
  91. {
  92. var str;
  93. var i=document.frmDocument.sltDocument.selectedIndex;
  94. if (i==0)
  95. {
  96.     try
  97.     {
  98.     alert(document.frmDocument.PleaseText.value);
  99. //Clearing body page    
  100.     str="<input type='Hidden' name='selecteddata' value=''>";
  101.     top.body.StoreData.innerHTML=str;
  102.     top.body.frmIndexField.target="_self";
  103.     top.body.frmIndexField.action="UtilBody.asp";
  104.     top.body.focus();
  105.     top.body.frmIndexField.submit();    
  106.     top.dialogHeight="275px";        
  107.     }
  108.     catch (e)
  109.     {
  110.     }
  111. }
  112. else
  113. {
  114.     try
  115.     {
  116.         top.body.StoreData.innerHTML=str;
  117.         top.body.frmIndexField.target="_self";
  118.  
  119.     //getting the change
  120.     str=document.frmDocument.sltDocument.options(i).value;
  121.     str="<input type='Hidden' name='selecteddata' value='" + str + "'>";
  122.     top.dialogHeight="350px";        
  123.     if (document.frmDocument.FirstLoad.value=="True")
  124.      {
  125. //        top.dialogHeight=22;        
  126.         document.frmDocument.FirstLoad.value="False";     
  127.      }
  128.         top.body.StoreData.innerHTML=str;
  129.         top.body.frmIndexField.action="UtilBody.asp";
  130.         top.body.frmIndexField.submit();
  131.     }
  132.     catch (e)
  133.     {
  134. //        window.goBack(0);
  135.     }
  136. }
  137.  
  138. }
  139.  
  140. function init()
  141. {
  142.         iTimer=window.setInterval("SetFocus()",50);
  143. }
  144.  
  145. //setting focus to combox
  146. function SetFocus()
  147. {
  148.     if (document.forms.length>0)
  149.     {
  150.         var nWidth=document.frmDocument.sltDocument.clientWidth +16;
  151.         if (nWidth>280)
  152.             {
  153.             top.dialogWidth= nWidth + "px";    
  154.             }
  155.         try
  156.         {        
  157.               document.frmDocument.sltDocument.focus();
  158.             window.clearInterval(iTimer);
  159.          }    
  160.        catch (e)
  161.        {
  162.     //       alert(e);
  163.            }
  164.     }
  165.     else
  166.     {        
  167.         window.clearInterval(iTimer);
  168.      }    
  169.       
  170. }
  171.  
  172. //opening and showing the about window
  173. function ShowAbout()
  174. {
  175.     var oOpener = top.dialogArguments;
  176.     oOpener.ShowAbout();
  177. }
  178. //opening and showing the about window
  179. function ShowHelp()
  180. {
  181.     var oOpener = top.dialogArguments;
  182.     oOpener.ShowHelp();
  183. }
  184.  
  185. //changing images when events fighting
  186. function RollImage(obj,i,j)
  187. {
  188. if (i==1)
  189.     {
  190.             if (j==1)
  191.                 obj.src="images/support_p.jpg";     
  192.             else
  193.                 {
  194.                  if (j==2)                     
  195.                      obj.src="images/help_p.jpg";     
  196.                  else        
  197.                     obj.src="images/about_p.jpg";
  198.                 }     
  199.     }
  200. else
  201.     {
  202.             if (j==1)
  203.                 obj.src="images/support.jpg";     
  204.             else
  205.                 {
  206.                  if (j==2)                     
  207.                      obj.src="images/help.jpg";     
  208.                  else        
  209.                     obj.src="images/about.jpg";
  210.                 }     
  211.     }
  212.  
  213. }
  214.  
  215. </script>
  216.  
  217. </head>
  218.  
  219. <!--- <body bgcolor="#A1AED0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0"  onload="SetFocus();" onunload="UnloadAll();"> --->
  220. <body bgcolor="#A1AED0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0"  onload="init();" oncontextmenu="return false">
  221. <%
  222.         dim oXML,nB,nD,nF
  223.         on error resume next
  224.         set oXML=CreateObject("RCXMLWEB.RCXMLUI")
  225.         if err then
  226.            %>
  227.            <center>
  228.            <table>
  229.                <tr>
  230.                    <td class="errorMessage"><%=display(3)%></td>
  231.                </tr>
  232.            </table>
  233.            </center>
  234.            <%
  235.            err.Clear
  236.            Response.End
  237.         end if
  238.         
  239. '        i=oXML.SetInfo(Application("PubTypesPath"),sWebRoot) 
  240. 'used for getting sample image file
  241.         i=oXML.SetInfo(Application("PubTypesPath")) 
  242.         if i<0 then
  243.            dim fso,f
  244.             Set fso = CreateObject("Scripting.FileSystemObject")
  245.             set f =fso.OpenTextFile(Application("LogFile"),8,true)
  246.             f.WriteLine oXML.ErrMessage
  247.             f.Close
  248.             set fso=nothing           
  249.         end if
  250.         %>
  251.  
  252. <center>
  253. <table border="0" cellpadding="0" cellspacing="0" bgcolor="White" width="100%">
  254.     <tr>
  255.         <td align="center" valign="middle"><image src="images/logo1.jpg">
  256.     </td>
  257. </tr>
  258. </table>
  259. <table width="100%" border="0" cellpadding="2" cellspacing="0">
  260.     <tr>
  261.         <td height="2"></td>
  262.     </tr>
  263.     <tr>        
  264.         <td align="right">
  265.                         <a href="#" onclick="ShowHelp();" ondrag="return false" > <img src="images/help.jpg" alt="Help" border="0" onmousedown='RollImage(this,1,2);' onmouseout='RollImage(this,2,2);' onmouseup='RollImage(this,2,2);'></a>                        
  266.                         <a href="#" onclick="ShowAbout();" ondrag="return false"> <img src="images/about.jpg" alt="About" border="0" onmousedown='RollImage(this,1,3);' onmouseout='RollImage(this,2,3);' onmouseup='RollImage(this,2,3);'></a>
  267.         </td>
  268.     </tr>
  269. </table>
  270. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  271.     <tr>
  272.         <td width="10"> </td>
  273.         <td class="indexlabels"><%=display(0)%></font>
  274.         </td>
  275.     </tr>
  276.     <tr>
  277.         <td width="10"> </td>
  278.         <td>
  279.             <form action="UtilBody.asp" method="post" name="frmDocument">
  280.             <select name="sltDocument" onchange="SubmitChange();" >
  281.                 <option value="0"><%=display(4)%></option>
  282.                 <%
  283.                     for nB=1 to oXML.Batches.Count
  284.                         for nD=1 to oXML.Batches(nB).Documents.Count
  285.                             for nF=1 to oXML.Batches(nB).Documents(nD).FormTypes.Count
  286.                                 %>
  287.                                 <option style="color: black; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular"  value='<%="" & oXML.Batches(nB).BatchClassID & "-" & oXML.Batches(nB).Documents(nD).DocumentClassName & "-" & oXML.Batches(nB).Documents(nD).FormTypes(nF).FormTypeName%>'  >
  288.                                 <%=oXML.Batches(nB).BatchClassName & "-" & oXML.Batches(nB).Documents(nD).DocumentClassName & "-" & oXML.Batches(nB).Documents(nD).FormTypes(nF).FormTypeName%>
  289.                                 </option>                                    
  290.                                 <%
  291.                             next
  292.                         next
  293.                     next            
  294.                     set oXML=nothing
  295.                 %>
  296.             </select>
  297.             <input type="Hidden" name="FirstLoad" value="True">
  298.             <input type="Hidden" name="PleaseText" value='<%=display(5)%>'>
  299.             </form>
  300.         </td>
  301.     </tr>
  302. </table>
  303. </center>
  304.  
  305.  
  306. </body>
  307. </html>
  308.